for(;;) /* Message-Loop */ { Wait(1L << Window->UserPort->mp_SigBit); while( msg = GetMsg(Window->UserPort) ) { class = msg->Class; code = msg->Code; ReplyMsg( msg ); switch( class) { case CLOSEWINDOW: close_all(); break; case MENUPICK: if (MENUNUM(code) != MENUNULL) do_menu(); break; } } } void do_menu() { switch(MENUNUM(code)) /* Switch Titel */ { case IDM_DATEI: switch(ITEMNUM(code)) { case IDM_D_NEU: Do_Neu(); break; case IDM_D_OEFFNEN: Do_Oeffnen(); break; } break; case IDM_BEARBEITEN: switch(ITEMNUM(code)) { case IDM_B_UNDO: do_Undo(); break; case IDM_B_COPY: do_Copy(); break; } break; } }